package com.feihong.yw189.http;

import android.content.Context;
import android.text.TextUtils;
import android.util.Log;

import com.blankj.utilcode.util.AppUtils;
import com.feihong.yw189.listener.http.RequestCallBack;
import com.feihong.yw189.utils.MyLoginUtils;
import com.feihong.yw189.utils.UserLoginInfo;

import org.xutils.common.Callback;
import org.xutils.http.HttpMethod;
import org.xutils.http.RequestParams;
import org.xutils.x;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Sabirjan on 2017/6/13.
 * TXGW.
 * 飞宏电子
 */

public class HttpTools {
    private static final String TAG = "营维189";

    // 余呈本地地址( 张鹏)
    public static final String HTTP_HOME = Host.HTTP_HOME;
    public static final String PAIDAN_DITU = HTTP_HOME + "/Send/SendApi/send_map";// 派单地图

    public static final String DISCOVER_HOME = HTTP_HOME + "App/Discover/index?time=";//发现
    public static final String KAIKA_STEP3_WEBURL = HTTP_HOME + "App/Phonecard/spec_info";//开卡--第三步骤 套餐
    public static final String KAIKA_STEP3_NEW_WEBURL = HTTP_HOME + "App/Phonecard/spec_list";//开卡--第三步骤 套餐
    public static final String KAIKA_STEP4_WEBURL = HTTP_HOME + "App/Phonecard/hk_detail";//开卡---第四步骤 详情
    public static final String PRODUCT_INFO_WEBURL = HTTP_HOME + "App/Terminal/detail";//终端详情页面
    public static final String USER_INFO_EDIT = HTTP_HOME + "App/Userinfo/edit_user_info"; //用户信息修改
    public static final String MENDIAN_DETAIL = HTTP_HOME + "App/Nearbyshops/shop_detail"; //附近门店详情

    public static final String MESSAGE_HOME = HTTP_HOME + "App/Message/index"; //系统信息首页
    public static final String MESSAGE_SYSTEM_LIST = HTTP_HOME + "App/Message/system_info_list";//系统消息列表
    public static final String MESSAGE_SYSTEM_DETAIL = HTTP_HOME + "";//系统消息页面
    public static final String KAIKA_ORDER_DETAIL = HTTP_HOME + "App/Myorder/order_details";//开卡订单的详情
    public static final String LOGIN_HELLP_REG = HTTP_HOME + "App/Userinfo/help";//通讯100-用户协议

    //白卡写卡
    public static final String BAI_KA = HTTP_HOME + "/App5/PhoneCard/check_baika";
    public static final String BU_KA = HTTP_HOME + "/App5/DjlmNewApi/check_buka";
    public static final String CLEAR_CARD = HTTP_HOME + "/App5/DjlmNewApi/clearcard";
    // 写卡成功接口
    public static final String BU_KA_OK = HTTP_HOME + "/App5/DjlmNewApi/buka_ok";
    public static final String KAIKA_DETAILS = HTTP_HOME + "/DxApp/Order/kaika_info.html";
    public static final String KUANDAI_DETAILS = HTTP_HOME + "/DxApp/Order/kuandai_info.html";
    //开卡详情页面
    public static final String BAI_KA_OK = HTTP_HOME + "/App5/PhoneCard/baika_ok";

    //更新App
    public static final String UPDATE_APP = "https://res.djlm.wang/app/android/yw189/app_update_yw189.json"; //更新App

    //身份证上传地址
    public static final String IDCARD_URL = HTTP_HOME + "/DxApp/Idcard/new_card.html";
    public static final String UPLOAD_IMG = HTTP_HOME + "/DxApp/Idcard/upload_img.html";
    // 获取店家联盟读卡ip
    public static final String GET_DJLM_IP = HTTP_HOME + "/DxApp/Idcard/get_mutexcomm.html";

    //开卡 获取开卡号码
    public static final String GET_KK_NUM = HTTP_HOME + "/DxApp/Kaika/get_phone.html";

    // 宽带获取开卡号码
    public static final String GET_KUANDAI_NUM = HTTP_HOME + "/DxApp/Kuandai/get_phone.html";
    // 获取套餐列表
    public static final String GET_SPECT = HTTP_HOME + "/DxApp/Spec/get_spec.html";

    public static final String MY_MONEY_ACCOUNT = HTTP_HOME + "/DxApp/User/shouzhi_list.html";//收支明细
    public static final String MY_MONEY_YDETAIL = HTTP_HOME + "/DxApp/User/jiakuan_list.html";//加款记录
    public static final String MY_MONEY_OUT = HTTP_HOME + "/DxApp/User/zhuanchu_list.html";//转出列表
    public static final String MY_MONEY_OUT_DETAIL = HTTP_HOME + "/DxApp/User/zhuanchu_info.html";//转出详情
    public static final String MY_MONEY_ACCOUNT_INFO = HTTP_HOME + "/DxApp/User/shouzhi_info.html";//收支明细详情
    public static final String MY_MONEY_YDETAIL_INFO = HTTP_HOME + "/DxApp/User/jiakuan_info.html";//加款记录详情

    public static final String ORDER_CARD_BUKA = HTTP_HOME + "/DxApp/Buka/order_up.html";//补卡


    //订单首页
    public static final String ORDER_LIST_PAGE = HTTP_HOME + "/DxApp/Order/index.html";
    //开卡订单列表
    public static final String ORDER_OPEN_CARD = HTTP_HOME + "/DxApp/Order/kaika_list.html";
    //开卡订单详情
    public static final String ORDER_OPEN_CARD_DETAIL = HTTP_HOME + "/DxApp/Order/kaika_info.html";
    //宽带订单列表
    public static final String ORDER_OPEN_KD = HTTP_HOME + "/DxApp/Order/kuandai_list.html";
    //宽带订单详情
    public static final String ORDER_OPEN_KD_DETAIL = HTTP_HOME + "/DxApp/Order/kuandai_info.html";
    //话费充值
    public static final String PHONE_RECHARGE = HTTP_HOME + "/DxApp/Hfchongzhi/index.html";
    //流量充值
    public static final String LIULIANG_RECHARGE = HTTP_HOME + "/DxApp/gprsRecharge/index.html";
    //首页更多
    public static final String SHOUYE_MORE = HTTP_HOME + "/DxApp/Index/more.html";
    //QQ充值
    public static final String QQ_RECHARGE = HTTP_HOME + "/DxApp/TencentRecharge/index.html";
    //关于我们
    public static final String ABOUT_US = HTTP_HOME + "/DxApp/Index/about_we.html";
    //套餐详情
    public static final String TAOCAN_DETAIL = HTTP_HOME + "/DxApp/Kaika/get_spec_info.html";
    //忘记密码
    public static final String FORGET_PASSWORD = HTTP_HOME + "/DxApp/Index/set_pwd.html";
    //更换手机号
    public static final String CHANGE_PHONE = HTTP_HOME + "/DxApp/Home/set_mobile.html";
    //修改支付密码
    public static final String ZHIFU_PASSWORD = HTTP_HOME + "/DxApp/Home/set_paypwd.html";
    //修改登录密码
    public static final String CHANGELOGIN_PASSWORD = HTTP_HOME + "/DxApp/Home/set_password.html";
    //平台公告
    public static final String PINGTAIGONGGAO = HTTP_HOME + "/DxApp/Home/notice.html";
    //分享页面
    public static final String SHARE_ACTIVITY = HTTP_HOME + "/DxApp/Yuyue/my_qrcode.html";
    //意见反馈
    public static final String OPINION = HTTP_HOME + "/DxApp/Home/feedback.html";
    //返利说明
    public static final String BACK_MONEY = HTTP_HOME + "/DxApp/Home/rebate_info.html";
    //服务协议
    public static final String SERVICE = HTTP_HOME + "/DxApp/Home/service_agreement.html";
    //支付宝支付
    public static final String ZHIFUBAO_PAY = HTTP_HOME + "/DxApp/Home/zhuan_alipay.html";
    //银联
    public static final String YINLIAN_PAY = HTTP_HOME + "/DxApp/Home/zhuan_bank.html";
    //银联
    public static final String WEIXIN_PAY = HTTP_HOME + "/DxApp/Pay/aliwebpay.html";

    //首页web
    public static final String WEB_FIST_PAGE = HTTP_HOME + "/DxApp/Index/home.html";
    //银联
    public static final String BUKA_PHONEINFO = HTTP_HOME + "/DxApp/Buka/phoneInfo";
    public static final String PHONEINFO = "http://61.128.122.14:9551/yigouWeb/H5Shopping_index.action";

    // 转出
    public static final String BUND_ZFB = HTTP_HOME + "/DxApp/User/binding_zhifubao.html";
    public static final String JIEBANG_ZFB = HTTP_HOME + "/DxApp/User/unbind_zhifubao.html";
    public static final String BUND_YHK = HTTP_HOME + "/DxApp/User/binding_bank_card.html";
    public static final String JIEBANG_YHK = HTTP_HOME + "/DxApp/User/unbind_bank_card.html";
    public static final String ZHUANCHU_ZFB_YHK = HTTP_HOME + "/DxApp/User/money_cash.html";
    public static final String ZHUANCHU_USER = HTTP_HOME + "/DxApp/User/fast_transfer_accounts.html";
    public static final String YZ_CODE = HTTP_HOME + "/DxApp/User/check_sms_send.html";
    public static final String SMRZ_SUB = HTTP_HOME + "/DxApp/User/real.html";
    public static final String ZHK_SQLJ = "https://app.cmbchina.com/DCAMobile/DApply/DSelectCard.aspx";
    /**
     * 系统消息详情接口
     */
    public static final String SYSTEM_MSG_INFO = HTTP_HOME + "/DxApp/User/msg_info.html";

    private static TokenUtils tokenUtils;
    /**
     * 首页通知消息弹窗接口
     */
    public static final String NOFITY_MSG_URL = "/DxApp/User/new_msg_notice.html";
    /**
     * 宽带订单提交接口
     */
    public static final String BR_ORDER_SUBMIT_URL = "/DxApp/Kuandai/order.html";
    /**
     * 宽带订单支付接口
     */
    public static final String BR_ORDER_PAY_URL = "/DxApp/Kuandai/order_pay.html";
    /**
     * 宽带订单 开户接口
     */
    public static final String BR_CREATEACCOUNT_URL = "/DxApp/Kuandai/order_up_kaihu.html";
    /**
     * 开卡订单提交接口
     */
    public static final String KK_ORDER_SUBMIT_URL = "/DxApp/Kaika/order.html";
    /**
     * 开卡订单支付接口
     */
    public static final String KK_ORDER_PAY_URL = "/DxApp/Kaika/order_pay.html";
    /**
     * 开卡订单 开户接口
     */
    public static final String KK_CREATEACCOUNT_URL = "/DxApp/Kaika/order_up_kaihu.html";
    /**
     * 站内信列表
     */
    public static final String STAND_INSIDE_LETTER_LIST_URL = "/DxApp/User/notice_list.html";
    /**
     * 站内信详情
     */
    public static final String STAND_INSIDE_LETTER_DETAIL_URL = "/DxApp/User/notice_info.html";

    public static final String YUYUE_ORDER_URL = "/DxApp/Yuyue/yuyue.html";

    /**
     * 首页功能列表
     */
    public static final String HOME_FUN_LIST_URL = "/DxApp/Home/index_menu.html";
    private TokenUtils getTokenUtils() {
        if (tokenUtils == null) {
            tokenUtils = new TokenUtils();
        }
        return tokenUtils;
    }

    /**
     * 暂无调用
     *
     * @param requestParams
     * @param commonCallback
     * @return
     */
    private Callback.Cancelable getHttpData(RequestParams requestParams, Callback.CommonCallback<String> commonCallback) {
        requestParams.setMethod(HttpMethod.GET);
        requestParams.addQueryStringParameter("ver", AppUtils.getAppVersionName());
        return x.http().get(requestParams, commonCallback);
    }


    /**
     * 获取首页数据   commonCallback
     *
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable getHomeData(RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "App/Index/shouye");
    }

    /**
     * 要发送的验证码
     * 发送短信验证码
     *
     * @param phoneNumber
     * @param type            类型  0号码修改
     * @param requestCallBack 回调 {"code":2301,"data":[],"msg":"请先输入电话号码"}
     * @return
     */
    public Callback.Cancelable sendPhoneCode(String phoneNumber, String type, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("phone", phoneNumber);
        mParams.put("type", type);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "App/Userinfo/send_check_code");
    }

    /**
     * 用户注册
     *
     * @param phoneNumber     手机号
     * @param code            收到的验证码
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable userRegister(String phoneNumber, String code, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("mobile", phoneNumber);
        mParams.put("code", code);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "App/Userinfo/reg_login");
    }


    /**
     * 上传文件
     *
     * @param zhengMian
     * @param requestCallBack
     * @return
     */
/*    public Callback.Cancelable uploadFile(File file, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap();
        HashMap<String, File> mFileParams = new HashMap();
        mParams.put("token", UserLoginInfo.getUserToken());
        mFileParams.put("image", file);
        return new HttpManage().postFileRequest(mParams, mFileParams, requestCallBack, HTTP_HOME + "/DxApp/Kuandai/order_up.html?cs=1&type=file");*/
    public Callback.Cancelable uploadFile(File zhengMian, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap();
        HashMap<String, File> mFileParams = new HashMap();
        mFileParams.put("image", zhengMian);
        return new HttpManage().postFileRequest(mParams, mFileParams, requestCallBack, HTTP_HOME + "/DxApp/Idcard/upload_img.html");
    }

    /**
     * 开卡  上传文件
     *
     * @param zhengMian
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable kaiKauploadFile(File zhengMian, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap();
        HashMap<String, File> mFileParams = new HashMap();
        mFileParams.put("image", zhengMian);
        return new HttpManage().postFileRequest(mParams, mFileParams, requestCallBack, HTTP_HOME + "/DxApp/Idcard/upload_img.html");
    }

    /*   *//**
     * 上传文件
     *
     * @param filePath        文件路径
     * @param requestCallBack
     * @return
     *//*
    public Callback.Cancelable uploadFile(String filePath, RequestCallBack requestCallBack) {
        return uploadFile(new File(filePath), requestCallBack);
    }*/


    /**
     * 用户密码修改
     *
     * @param type            1:登录密码  2:支付密码
     * @param newPwd          新密码
     * @param oldPwd          旧密码
     * @param rePwd           确认密码
     * @param version         版本
     * @param sign            sign
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable changePwd(String type, String newPwd, String oldPwd, String rePwd, String version, String sign, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("new_pwd", newPwd);
        mParams.put("old_pwd", oldPwd);
        mParams.put("re_pwd", rePwd);
        mParams.put("type", type);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "App/Userinfo/reg_login");
    }

    /**
     * 获取个人信息
     *
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable userInfo(RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("version", "and." + AppUtils.getAppVersionName());
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/User/info.html");
    }

    /**
     * 登录
     *
     * @param user_name       用户名
     * @param user_password   密码
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable login(String user_name, String user_password, Context context, RequestCallBack requestCallBack) {
        MyLoginUtils loginUtils = new MyLoginUtils(context);
        loginUtils.setUser_name(user_name);
        loginUtils.setUser_password(user_password);

        String phone_os = loginUtils.getPhone_os();
        String phone_type = loginUtils.getPhone_type();
        String phone_brand = loginUtils.getPhone_brand();
        String phone_imei = loginUtils.getPhone_imei();
        String phone_gps = loginUtils.getPhone_gps();
        String Network = loginUtils.getNetwork();
        String Phone_num = loginUtils.getPhone_num();

        HashMap<String, String> mParams = new HashMap<>();
        String lon = UserLoginInfo.getUserLoginInfoInstance().getUserLoc().getUserLon();
        String lat = UserLoginInfo.getUserLoginInfoInstance().getUserLoc().getUserLat();
        mParams.put("long", TextUtils.isEmpty(lon) ? "" : lon);
        mParams.put("lat", TextUtils.isEmpty(lat) ? "" : lat);
        mParams.put("name", user_name);
        mParams.put("network", Network);
        mParams.put("password", user_password);
        mParams.put("phone_brand", phone_brand);
        mParams.put("phone_gps", phone_gps);
        mParams.put("phone_imei", phone_imei);
        mParams.put("phone_num", Phone_num);
        mParams.put("phone_os", phone_os);
        mParams.put("phone_type", phone_type);
        mParams.put("version", "and." + AppUtils.getAppVersionName());
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Login/login.html");
    }


//    /**
//     * 获取sim卡号
//     * @param
//     * @param
//     * @param
//     * @return
//     */
//    public Callback.Cancelable getSim(String title,int page,int page_size,RequestCallBack requestCallBack) {
//        MyLoginUtils loginUtils = new MyLoginUtils();
//        long time = loginUtils.getCuurrentTime();
//        String token = UserLoginInfo.getUserToken();
//
//        String signStr;
//        if(!TextUtils.isEmpty(title)){
//            signStr =  String.valueOf(page)
//                    +String.valueOf(page_size)
//                    +time
//                    +title
//                    + GlobalConfig.PUBLIC_KEY;
//        }else{
//            signStr = String.valueOf(page)
//                    +String.valueOf(page_size)
//                    +time
//                    +title
//                    + GlobalConfig.PUBLIC_KEY;
//        }
//
//        String sign = loginUtils.encode(signStr);
//        HashMap<String,String> mParams = new HashMap<>();
//        mParams.put("page_size", ""+page_size);
//        mParams.put("sign",signStr);
//        mParams.put("time",""+time);
//        mParams.put("page","" + page);
//        mParams.put("token",token);
//        if(!TextUtils.isEmpty(title)){
//            mParams.put("title",title);
//        }
//        return new HttpManage().postRequest(mParams, requestCallBack,HTTP_HOME + "/DxApp/Kuandai/get_iccid.html");
//    }


    /**
     * 获取座机号
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getZuiji(String page, String page_size, String title, String acc_type, String segm_id, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("acc_type", acc_type);
        mParams.put("page", page);
        mParams.put("page_size", page_size);
        mParams.put("segm_id", segm_id);
        if (!TextUtils.isEmpty(title)) {
            mParams.put("title", title);
        }
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kuandai/get_tel.html");
    }

    /**
     * 获取排行
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getPaiHang(String page, String pageSize, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("page", page);
        mParams.put("page_size", pageSize);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Home/paihang.html");
    }

    /**
     * 获取座机号
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getZuiji_JuXiang(String page, String page_size, String title, String dire_no, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("dire_no", dire_no);
        mParams.put("page", page);
        mParams.put("page_size", page_size);
        if (!TextUtils.isEmpty(title)) {
            mParams.put("title", title);
        }
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kuandai/get_tel.html");
    }

    /**
     * 获取手机号
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getPhone(String group_id, String title, int page, int page_size, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("group_id", group_id);
        mParams.put("page", "" + page);
        mParams.put("page_size", "" + page_size);
        mParams.put("page", "" + page);
        if (!TextUtils.isEmpty(title)) {
            mParams.put("title", title);
        }
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kuandai/get_phone.html");
    }

    /**
     * 获取报装地址
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getBaozhuang(String title, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("title", title);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kuandai/get_address.html");
    }

    /**
     * 获取报装地址   手输
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getEditBaozhuang(RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kuandai/get_juxiang.html");
    }


    /**
     * 修改用户性别和生日
     *
     * @param btd             生日
     * @param sex             性别
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable changeSex(String btd, String sex, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("birthday", btd);
        mParams.put("sex", sex);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/App5/User/change_pdata");
    }

    /**
     * 修改密码
     *
     * @param newPwd          新密码
     * @param oldPwd          旧密码
     * @param type            类型
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable changePwd(String newPwd, String oldPwd, String type, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("new_pwd", newPwd);
        mParams.put("old_pwd", oldPwd);
        mParams.put("re_pwd", oldPwd);
        mParams.put("type", type);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/App5/User/change_pwd");
    }

    /**
     * 退出登录
     *
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable exitLogin(RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();

        HttpManage.LOGIN_TYPE = 1;
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Login/logout.html");
    }

    /**
     * /**
     * 加款记录列表 | 收支明细列表  |冻结列表
     *
     * @param urlType         网址
     * @param page            第几页
     * @param page_size       一页多少个
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable addingMoneyList(int page, int page_size, String urlType, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("page", "" + page);
        mParams.put("page_size", "" + page_size);

        return new HttpManage().postRequest(mParams, requestCallBack, urlType);
    }

    /**
     * 加款记录详情
     *
     * @param order_sn        订单号
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable addingMoneyDetail(String order_sn, String urlType, int type, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("id", "" + order_sn);
        return new HttpManage().postRequest(mParams, requestCallBack, urlType);
    }

    /**
     * 上传用户头像图片
     *
     * @param file            文件对象
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable uploadImgFile(File file, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap();
        HashMap<String, File> mFileParams = new HashMap();
        mFileParams.put("image", file);
        return new HttpManage().postFileRequest(mParams, mFileParams, requestCallBack, HTTP_HOME + "/DxApp/User/set_user_images.html?type=file");
    }

    /**
     * 修改用户手机号码
     *
     * @param phoneNum
     * @param password        登录密码
     * @param sms_no          短信验证码
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable editPhoneNum(String phoneNum, String password, String sms_no, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("phone", phoneNum);
        mParams.put("password", "" + password);
        mParams.put("sms_no", "" + sms_no);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/User/set_user_phone.html");
    }

    /**
     * 修改用户支付密码
     *
     * @param pay_pwd         新密码
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable editPayPwd(String pay_pwd, String sms_no, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("token", UserLoginInfo.getUserLoginInfoInstance().getUserToken());
        mParams.put("pay_pwd", pay_pwd);
        mParams.put("sms_no", "" + sms_no);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/User/set_pay_pwd.html");
    }

    /**
     * 修改用户登录密码
     *
     * @param password        新密码
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable editPwd(String password, String sms_no, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("password", password);
        mParams.put("sms_no", "" + sms_no);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/User/set_password.html");
    }

    /**
     * 系统消息列表
     *
     * @param page            页数
     * @param page_size       一页多少个
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable SystemMessageList(String page, String page_size, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("page", page);
        mParams.put("page_size", page_size);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/User/msg_list.html");
    }


    public Callback.Cancelable SystemMessageInfo(String msgID, RequestCallBack<String> requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("id", msgID);
        return new HttpManage().postRequest(mParams, requestCallBack, SYSTEM_MSG_INFO);
    }

    /**
     * 获取sim卡号
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getSim(String title, int page, int page_size, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("page_size", "" + page_size);
        mParams.put("page", "" + page);
        if (!TextUtils.isEmpty(title)) {
            mParams.put("title", title);
        }
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kuandai/get_iccid.html");
    }

    /**
     * 获取套餐
     *
     * @param SpectType       套餐类型  1  为开卡套餐   2为宽带套餐
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable getSpecInfo(String SpectType, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>(16);
        mParams.put("type", SpectType);
        return new HttpManage().postRequest(mParams, requestCallBack, GET_SPECT);
    }

    /**
     * 获取开卡手机号码
     *
     * @param group_id
     * @param phoneNumType    号码类型
     * @param title
     * @param page
     * @param page_size
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable getPhoneNum(String group_id, Map<String, String> phoneNumType, String title,
                                           int page, int page_size, RequestCallBack requestCallBack, String url) {
        HashMap<String, String> mParams = new HashMap<>();
        if (phoneNumType != null) {
            for (String key : phoneNumType.keySet()) {
                mParams.put(key, phoneNumType.get(key));
            }
        }
        mParams.put("group_id", group_id);
        mParams.put("page", page + "");
        mParams.put("page_size", page_size + "");
        mParams.put("title", title);
        return new HttpManage().postRequest(mParams, requestCallBack, url);
    }

    /**
     * @param data
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable submitCardMsg(String bleNum, String data, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("card_reader", bleNum);
        mParams.put("data", data);
        return new HttpManage().postRequest(mParams, requestCallBack, IDCARD_URL);
    }

    /**
     * 首页请求
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getShouYe(RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Home/index.html");
    }

    /**
     * 查询   补卡号码
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getBukaNumber(RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kuandai/get_juxiang.html");
    }

    /**
     * 发送用户短信验证码
     *
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable sendCode(RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/User/sms_send.html");
    }

    /**
     * 获取开卡套餐
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getKaikaTaoCan(RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kaika/get_spec.html");
    }

    public Callback.Cancelable getDJLMIP(RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        return new HttpManage().postRequest(mParams, requestCallBack, GET_DJLM_IP);
    }

    /**
     * 获取一证五户
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getYiZhengWuHu(String idcard, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("idcard", idcard);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kuandai/check_idcard.html");
    }

    /**
     * 获取一证五户
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getKuanDaiSubmit(String cardRead, String mobileOne, String mobileTwo, String my_tel, String my_address, String phone, String iccid,
                                                String groupId, String specId, String sulv, String user_images, String idcardName, String idNum, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("buyer_mobile", mobileOne);
        mParams.put("buyer_tel", mobileTwo);
        mParams.put("group_id", groupId);
        mParams.put("card_name", idcardName);
        mParams.put("card_id", idNum);
        mParams.put("card_reader", cardRead);
        mParams.put("iccid", iccid);
        mParams.put("my_tel", my_tel);
        mParams.put("my_address", my_address);
        mParams.put("phone", phone);
        mParams.put("sulv", sulv);
        mParams.put("spec_id", specId);
        mParams.put("user_images", user_images);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kuandai/order_up.html");
    }

    public Callback.Cancelable submitNewKaikaOrder(String url, HashMap<String, String> requestParams, RequestCallBack<String> requestCallBack) {
        requestParams.put("token", UserLoginInfo.getUserLoginInfoInstance().getUserToken());
        return new HttpManage().postRequest(requestParams, requestCallBack, Host.HTTP_HOME + url);
    }

    /**
     * @param packageGroupID 套餐组id
     * @param packageID      套餐id
     * @param phoneNumID     手机号码id
     * @param IDCardNum      身份证号码
     * @param IDCardName     身份证名称
     * @param contactPhone   联系方式
     * @param imgJson
     * @return
     */
    public Callback.Cancelable submitKaikaOrder(String cardReader, String packageGroupID, String packageID, String phoneNumID,
                                                String IDCardNum, String IDCardName,
                                                String contactPhone, String imgJson, String main_mobile, RequestCallBack<String> requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();

        mParams.put("spec_id", packageID);
        mParams.put("group_id", packageGroupID);
        mParams.put("phone", phoneNumID);
        mParams.put("card_id", IDCardNum);
        mParams.put("card_name", IDCardName);
        mParams.put("card_reader", cardReader);
        mParams.put("buyer_tel", contactPhone);
        mParams.put("main_mobile", main_mobile);
        mParams.put("user_images", imgJson);
        // 测试完 去掉最后一个参数
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kaika/order_up.html");
    }

    /**
     * 获取一证五户
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getKuanDaiPassWorld(String order_sn, String pay_pwd, String zhiwenkey, String randomNum, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_sn", order_sn);
        mParams.put("pay_pwd", pay_pwd);
        if (!TextUtils.isEmpty(zhiwenkey)) {
            mParams.put("touch_pwd", zhiwenkey);
            mParams.put("touch_num", randomNum);
        }
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kuandai/order_pay.html");
    }

    /**
     * 开卡  提交订单  支付接口
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getKaiKaPassWorld(String order_sn, String pay_pwd, String zhiwenkey, String randomNum, String url, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_sn", order_sn);
        mParams.put("pay_pwd", pay_pwd);
        if (!TextUtils.isEmpty(zhiwenkey)) {
            mParams.put("touch_pwd", zhiwenkey);
            mParams.put("touch_num", randomNum);
        }
        // /DxApp/Kaika/order_pay.html
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + url);
    }

    /**
     * 开卡  提交订单  支付接口
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getKaiKaKaiHu(String order_sn, String url, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_sn", order_sn);
        //   ""
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + url);
    }


    /**
     * 补卡  提交订单  对比
     */
    public Callback.Cancelable getBuKaDuiBi(String order_sn, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_sn", order_sn);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Buka/order_duibi.html");
    }

    /**
     * 补卡  提交订单  开户
     */
    public Callback.Cancelable getBuKaKaiHui(String order_sn, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_sn", order_sn);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Buka/order_up_jiekou.html");
    }


    /**
     * 验证转账权限
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getZhuanZhang(RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/User/is_zhuanzhang.html");
    }

    /**
     * 开卡  提交订单  支付接口
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getKuanDaiKaiHu(String order_sn, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_sn", order_sn);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kaika/order_pay.html");
    }

    /**
     * 补传照片  订单详情页
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getAddPicSubmit(String addUrl_rep, String PicType, String appPhotoUrl, String keyWordOrderSn, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_sn", keyWordOrderSn);
        mParams.put("type", PicType);
        mParams.put("url_img", addUrl_rep);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + appPhotoUrl);
    }

    /**
     * 补传照片  订单详情页
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getDetailSubmitPhontNum(String GroupId, String appPhotoUrl, String keyWordOrderSn, String orderPhone, String phone, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("group_id", GroupId);
        mParams.put("order_sn", keyWordOrderSn);
        mParams.put("order_phone", orderPhone);
        mParams.put("phone", phone);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + appPhotoUrl);
    }


    /**
     * 提交修改的iccid  订单详情页
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getDetailChangeIccidNum(String appPhotoUrl, String simNumber, String oldIccid, String keyWordOrderSn, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("iccid", simNumber);
        mParams.put("order_sn", keyWordOrderSn);
        mParams.put("order_iccid", oldIccid);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + appPhotoUrl);
    }

    /**
     * 提交修改的iccid  订单详情页
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getDetailChangeZuiJi(String appPhotoUrl, String oldOrder_tel, String tel, String tel_sn, String keyWordOrderSn, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_tel", oldOrder_tel);
        mParams.put("order_sn", keyWordOrderSn);
        mParams.put("tel", tel);
        mParams.put("tel_sn", tel_sn);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + appPhotoUrl);
    }


    /**
     * 提交修改的手机号   开卡订单详情
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getKaiKaDetailChangePhoneNum(String order_phone, String specgId, String appPhotoUrl, String Kaika_NumPhone, String keyWordOrderSn, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("group_id", specgId);
        mParams.put("phone", Kaika_NumPhone);
        mParams.put("order_sn", keyWordOrderSn);
        mParams.put("order_phone", order_phone);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + appPhotoUrl);
    }


    /**
     * 提交修改的手机号   开卡订单详情
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getDetailChangeHandSign(String handSignUrl, String handsigntype, String appPhotoUrl, String keyWordOrderSn, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_sn", keyWordOrderSn);
        mParams.put("type", handsigntype);
        mParams.put("url_img", handSignUrl);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + appPhotoUrl);
    }

    /**
     * 绑定,解绑支付宝/银行卡
     *
     * @param pay_pwd         支付密码
     * @param alipay_account  支付宝账号
     * @param alipay_user     支付宝用户名
     * @param url             接口
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable bundZfb(String pay_pwd, String alipay_account, String alipay_user,
                                       String url, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("pay_pwd", pay_pwd);
        mParams.put("account", alipay_account);
        mParams.put("user", alipay_user);
        return new HttpManage().postRequest(mParams, requestCallBack, url);
    }


    /**
     * 转出到银行卡/支付宝
     *
     * @param pay_pwd
     * @param cash_bank
     * @param cash_money
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable zhuanChu_zfb_yhk(String pay_pwd, String cash_bank, String cash_money, String zhiwenkey, String randomNum,
                                                RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("pay_pwd", pay_pwd);
        mParams.put("cash_bank", cash_bank);
        mParams.put("cash_money", cash_money);
        if (!TextUtils.isEmpty(zhiwenkey)) {
            mParams.put("touch_pwd", zhiwenkey);
            mParams.put("touch_num", randomNum);
        }
        return new HttpManage().postRequest(mParams, requestCallBack, ZHUANCHU_ZFB_YHK);
    }

    /**
     * @param pay_pwd
     * @param user_name
     * @param money
     * @param content
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable zhuanChuUser(String pay_pwd, String user_name, String money,
                                            String content, String zhiwenkey, String randomNum, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("pay_pwd", pay_pwd);
        mParams.put("user_name", user_name);
        mParams.put("money", money);
        mParams.put("content", content);
        if (!TextUtils.isEmpty(zhiwenkey)) {
            mParams.put("touch_pwd", zhiwenkey);
            mParams.put("touch_num", randomNum);
        }
        return new HttpManage().postRequest(mParams, requestCallBack, ZHUANCHU_USER);
    }

    public Callback.Cancelable yanZhengCode(String code, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("sms_no", code);
        return new HttpManage().postRequest(mParams, requestCallBack, YZ_CODE);
    }

    public Callback.Cancelable subShiMing(String idcard, String tel, String real_photo, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("idcard", idcard);
        mParams.put("tel", tel);
        mParams.put("real_photo", real_photo);
        return new HttpManage().postRequest(mParams, requestCallBack, SMRZ_SUB);
    }


    /**
     * 客户验证   验证身份证手机号
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getYzIdcard(String idcard, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("idcard", idcard);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kuandai/check_idcard.html");
    }

    /**
     * 微信支付
     *
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable getWeiXinPay(String money, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("bank_code", "wxpay_app");
        mParams.put("money", money);
        return new HttpManage().postRequest(mParams, requestCallBack, WEIXIN_PAY);
    }

    /**
     * 微信支付
     *
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable getBuKaPhoneInfo(String phoneNum, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("phone", phoneNum);
        return new HttpManage().postRequest(mParams, requestCallBack, BUKA_PHONEINFO);
    }


    /**
     * @param phone   手机号码id
     * @param iccid   iccid id
     * @param idcard  身份证号码
     * @param imgJson
     * @return
     */
    public Callback.Cancelable submitBuKaOrder(String phone, String iccid, String idcard, String imgJson, RequestCallBack<String> requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("phone", phone);
        mParams.put("iccid", iccid);
        mParams.put("idcard", idcard);
        mParams.put("user_images", imgJson);
        return new HttpManage().postRequest(mParams, requestCallBack, ORDER_CARD_BUKA);
    }

    /**
     * 获取报装地址
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable getYanZhengAdress(String accType, String segm_id, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("acc_type", accType);
        mParams.put("segm_id", segm_id);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kuandai/check_address.html");
    }

    public Callback.Cancelable getCardData(RequestCallBack<String> requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Idcard/get_card_data.html");
    }

    /***
     * 开启关闭指纹支付
     * @param context
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable openFinger(Context context, String touch_pwd, RequestCallBack<String> requestCallBack) {
        //'phone_os','phone_type','phone_brand','phone_imei','version'
        HashMap<String, String> mParams = new HashMap<>();
        MyLoginUtils loginUtils = new MyLoginUtils(context);
        String phone_os = "Android";
        String phone_type = "Android";
        String phone_brand = "";
        String phone_imei = System.currentTimeMillis() + "";
        try {
            phone_os = loginUtils.getPhone_os();
            phone_type = loginUtils.getPhone_type();
            phone_brand = loginUtils.getPhone_brand();
            phone_imei = loginUtils.getPhone_imei();
        } catch (Exception ex) {
        }
        mParams.put("phone_os", phone_os);
        mParams.put("phone_type", phone_type);
        mParams.put("phone_brand", phone_brand);
        mParams.put("phone_imei", phone_imei);
        if (!TextUtils.isEmpty(touch_pwd) && touch_pwd.length() == 32) {
            mParams.put("touch_pwd", touch_pwd);//关闭
            mParams.put("close", "1");
        } else {
            mParams.put("pay_pwd", touch_pwd);//开启
        }
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Pay/sign_touch");
    }

    /****
     * webView Ajax 请求处理
     * @param url 请求地址 可以http 开头的全路径 也可以相对路径 "/DxApp/xxx/xxx"
     * @param mParams 请求参数
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable ajaxPost(String url, HashMap<String, String> mParams, int timeOut, RequestCallBack<String> requestCallBack) {
        if (url.startsWith("http")) {
            return new HttpManage().postRequest(mParams, requestCallBack, url, timeOut);
        }
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + url, timeOut);
    }

    /**
     * 派单获取历史订单
     *
     * @param order_no
     * @param orderType
     * @param list
     * @param page
     * @param requestCallBack
     */
    public Callback.Cancelable getHistoryList(String order_no, String data, int orderType, String list, int page, RequestCallBack<String> requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("date_type", data);
        mParams.put("order_no", order_no);
        mParams.put("type", orderType + "");
        mParams.put("action", "list");
        mParams.put("page", page + "");

        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/Send/SendApi/order_list");

    }

    /**
     * 派单获取新订单
     *
     * @param page
     * @param requestCallBack
     */
    public Callback.Cancelable getNewList(int page, String search, RequestCallBack<String> requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("page", page + "");
        mParams.put("search_note", search);
        Log.e("项目异常", "------getNewList------" + search);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/Send/SendApi/new_order_list");

    }

    /**
     * 取消
     *
     * @param type
     * @param orderSn
     * @param orderType
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable tbOreCancle(int type, String orderSn, String orderType, RequestCallBack<String> requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("type", type + "");
        mParams.put("order_sn", orderSn);
        mParams.put("order_type", orderType);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/Send/SendApi/cancel_order");
    }

    /**
     * 转派
     *
     * @param orderSn
     * @param userName
     * @param requestCallBack
     */
    public Callback.Cancelable zhuanPai(String orderSn, String userName,
                                        RequestCallBack<String> requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_sn", orderSn);
        mParams.put("user_name", userName);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/Send/SendApi/zhuanpai");
    }

    /**
     * 备注
     *
     * @param orderSn
     * @param remark
     * @param requestCallBack
     */
    public Callback.Cancelable beiZhu(String orderSn, String remark, String data,
                                      RequestCallBack<String> requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_sn", orderSn);
        mParams.put("remark", remark);
        mParams.put("date_time", data);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/Send/SendApi/order_remark");
    }

    /**
     * 派单首页获取列表
     *
     * @param list
     * @param requestCallBack
     */
    public Callback.Cancelable getPaiDanHome(String list, String search, RequestCallBack<String> requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("action", list);
        mParams.put("search_note", search);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/Send/SendApi/get_order");
    }

    /**
     * 派单首页获取列表
     *
     * @param list
     * @param requestCallBack
     */
    public Callback.Cancelable getPaiDan(String list, String Latitude, String Longitude, RequestCallBack<String> requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("action", list);
        mParams.put("Latitude", Latitude);
        mParams.put("Longitude", Longitude);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/Send/SendApi/get_order");
    }

    /**
     * 设置状态
     *
     * @param Latitude
     * @param Longitude
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable setState(String Latitude, String Longitude, RequestCallBack<String> requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("Latitude", Latitude);
        mParams.put("Longitude", Longitude);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME
                + "/Send/SendApi/set_user?t1=" + System.currentTimeMillis());
    }

    /**
     * 获取状态
     *
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable getState(RequestCallBack<String> requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME
                + "/Send/SendApi/get_user?t1=" + System.currentTimeMillis());
    }

    /**
     * 完成
     *
     * @param orderSn
     * @param orderType
     * @param phoneNum
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable finishOrder(String orderSn, String orderType, String phoneNum, RequestCallBack<String> requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_sn", orderSn);
        mParams.put("order_type", orderType);
        mParams.put("phonenum", phoneNum);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/Send/SendApi/ok_yuyue_order");
    }

    /**
     * 退单
     *
     * @param orderSn
     * @param str
     * @param type
     * @param order_type
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable tuiDan(String orderSn, String str, int type, String order_type, RequestCallBack<String> requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_sn", orderSn);
        mParams.put("note", str);
        mParams.put("order_type", order_type);
        mParams.put("td_type", type + "");
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/Send/SendApi/single_back");
    }

    /**
     * 预约明细
     *
     * @param
     * @param
     * @param
     * @return
     */
    public Callback.Cancelable shareDetaiList(String page, String pageSize, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("page", page);
        mParams.put("page_size", pageSize);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Yuyue/order_list.html");
    }


    /****
     * 扫码检查ICCID
     * @param iccid
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable checkICCID(String iccid, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("iccid", iccid);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kaika/set_iccid.html");
    }

    /****
     * 检查号码是否可用
     * @param phoneNum
     * @param type 号码类型
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable phoneIsUsed(String phoneNum, String type, RequestCallBack requestCallBack) {

        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("mobile", phoneNum);
        mParams.put("type", type);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/DxApp/Kaika/check_mobile.html");
    }

    /**
     * 派单记录打电话时间
     *
     * @param orderSn
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable callPhoneData(String orderSn, RequestCallBack requestCallBack) {
        long time = MyLoginUtils.getCuurrentTime();
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_sn", orderSn);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/Send/SendApi/set_call_phone_data");
    }

    /**
     * 接单
     *
     * @param orderSn
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable jieDanRequest(String orderSn, RequestCallBack requestCallBack) {
        long time = MyLoginUtils.getCuurrentTime();
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("order_sn", orderSn);
        mParams.put("time", "" + time);
        return new HttpManage().postRequest(mParams, requestCallBack, HTTP_HOME + "/Send/SendApi/new_jiedan");
    }

    public Callback.Cancelable h5NetWork(HashMap<String, String> params, RequestCallBack requestCallBack) {
        String url = params.remove("url");
        if (TextUtils.isEmpty(url)) {
            return null;
        }
        return new HttpManage().postRequestNonSign(params, requestCallBack, HTTP_HOME + url);
    }

    /**
     * 获取站内信信息列表
     *
     * @param pageCount       页面请求消息数
     * @param pageSize        页数
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable getStandInsidLetterInfoList(String pageCount, String pageSize, RequestCallBack requestCallBack) {
        HashMap<String, String> mParams = new HashMap<>();
        mParams.put("page", pageSize);
        mParams.put("page_size", pageCount);
        return new HttpManage().postRequest(new HashMap<>(), requestCallBack, HTTP_HOME + STAND_INSIDE_LETTER_LIST_URL);
    }

    /**
     * 获取通知信息
     *
     * @param requestCallBack
     * @return
     */
    public Callback.Cancelable getNoticeMsgInfo(RequestCallBack requestCallBack) {
        return new HttpManage().postRequest(new HashMap<>(), requestCallBack, HTTP_HOME + NOFITY_MSG_URL);
    }

    public Callback.Cancelable getHomeFunList(RequestCallBack requestCallBack){
        return new HttpManage().postRequest(new HashMap<>(),requestCallBack,HTTP_HOME + HOME_FUN_LIST_URL);
    }
}
